var Registration = (function () {


	$(document).ready(function () {

		$("#register").on("click", function () {
			registerUser();
		});
	});


	function registerUser() {
		if ($("#password").val() != $("#confirmPassword").val()) {
			alert("Password and confirmed Password do not match");
			return;
		}
		var user = {};
		user.userId = $("#userId").val();
		user.email = $("#email").val();
		user.password = $("#password").val();

		UserMgtService.registerUser(user, registerUser_Result);
	}

	function registerUser_Result(data) {
		alert("Registered");
		$(".registration-result").append("<div class='alert alert-success'> <a class='close' data-dismiss='alert'>×</a> <strong>Success!</strong>You have been registered successfully. Click Here<a href='login.html'></a> to Login</div>");

	}

})();